/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.ages.input

import java.awt.event.KeyEvent
import java.awt.event.KeyListener
import scala.collection.mutable.HashMap

class SKeyboard extends KeyListener{

  private val keyStates = new HashMap[Int,Boolean]()

  def get(key:Int) =
    {
      if(!keyStates.contains(key))
        false
      else
        keyStates(key)
    }

  def keyTyped(ke:KeyEvent){
    
  }
  def keyPressed(ke:KeyEvent){
    keyStates.put(ke.getKeyCode, true)
  }
  def keyReleased(ke:KeyEvent){
    keyStates.put(ke.getKeyCode, false)
  }

}
